using Fungus;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class 水池Trigger : MonoBehaviour
{
    public GameObject tips;
    public string Chatname;
    public bool cantalk = false;
    // Start is called before the first frame update
    private void OnTriggerStay(Collider other)
    {
        Cursor.lockState = CursorLockMode.Confined;
        Flowchart flowchart3 = GameObject.Find("Flowchart3").GetComponent<Flowchart>();
        tips.SetActive(true);
        cantalk = true;

        if (cantalk == true)
        {
            if (Input.GetKeyDown(KeyCode.F))
            {
                flowchart3.ExecuteBlock(Chatname);
                cantalk = false;
            }
        }
        

    }
    private void OnTriggerExit(Collider other)
    {
        tips.SetActive(false);
        cantalk = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
}
